<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>伸缩盒</title>
</head>
<style>
    .parent{
        border:1px solid #333;
        display: flex;
        flex-wrap: wrap;
        /* height: 400px; */

        /* justify-content: center;
        align-items: center; */
        
        /* flex-direction
        row 弹性元素在横向方向（x）上排布
        column 弹性元素在纵向方向（y）上排布 */

        /* 主轴 为y轴 交叉轴 为x轴 
        flex-direction: column;
        align-items: center;*/
       
        /* 主轴 为x轴 交叉轴 为y轴 
        flex-direction: row;
        justify-content: center;*/
        
    }
    .item{
        height: 100px;
        width: 100px;
        margin: 20px;
        border:1px solid #333;
        /* flex: 1; */
    }
</style>
<body>
    <div class="parent">
        <div class="item">伸缩盒伸缩盒伸缩盒伸缩盒伸缩盒伸缩盒伸缩盒伸缩盒</div>
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
    </div>
</body>
</html>